<?php

require 'connect.inc';
$id = $_REQUEST["id"];
$res = "";
if ($type = 1)
    $strSQL = "SELECT user_id,  user_name,  email,  full_name
	FROM users us
	WHERE country_id = $id";
else
    $strSQL = "SELECT user_id,  user_name,  email,  full_name
	FROM users us
	WHERE department_id = $id";
$result = mysql_query($strSQL);
if ($result && mysql_num_rows($result) > 0) {
    $res .= "<table class='f11' border='1'>
                <tr>
                    <th>STT</th>
                    <th>User  ID</th>
                    <th>User  name</th>
                    <th>Email</th>
                    <th>Full name</th> 
                   </tr>";
    $stt = 0;
    while ($row = mysql_fetch_array($result)) {
        $stt++;
        $id = $row["user_id"];
        $name = $row["user_name"];
        $email = $row["email"];
        $fullname = $row["full_name"];
        $res .= "<tr>
                    <td>$stt</td>
                    <td>$id</td>
                    <td>$name</td>
                    <td>$email</td>
                    <td>$fullname</td>
               </tr>";
    }
    $res .= "</table>";
    echo $res;
}
?>